load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test")

package(default_visibility = ["//visibility:public"])

DEPENDENCIES = [
    # Keep sorted.
    "//rs/interfaces/registry",
    "//rs/protobuf",
    "//rs/registry/fake",
    "//rs/registry/helpers",
    "//rs/registry/local_store",
    "//rs/registry/nns_data_provider",
    "//rs/registry/transport",
    "//rs/types/types",
    "@crate_index//:parking_lot",
    "@crate_index//:thiserror",
    "@crate_index//:tokio",
    "@crate_index//:url",
]

rust_library(
    name = "local_registry",
    testonly = True,
    srcs = glob(["src/**/*.rs"]),
    crate_name = "ic_registry_local_registry",
    version = "0.9.0",
    deps = DEPENDENCIES,
)

rust_test(
    name = "local_registry_test",
    size = "large",
    args = [
        "--test-threads",
        "1",
    ],
    crate = ":local_registry",
    deps = [
        # Keep sorted.
        "//rs/test_utilities/registry",
    ],
)
